package com.server.rule.factory;

import org.jeasy.rules.api.RulesEngine;
import org.jeasy.rules.core.DefaultRulesEngine;

/**
 * Description: This is a sample class.
 * @Author Simon
 */
public class RuleEngineFactory {
    private volatile static RulesEngine ruleEngine;

    private RuleEngineFactory() {
    }

    public static RulesEngine getInstance() {
        if (ruleEngine == null) {
            synchronized (RuleEngineFactory.class) {
                if (ruleEngine == null) {
                    ruleEngine = new DefaultRulesEngine();
                }
            }
        }
        return ruleEngine;
    }
}
